﻿//************************************************************************************************
// Copyright © 2014 Steven M. Cohn. All Rights Reserved.
// 
//************************************************************************************************

namespace River.Folderize
{
	using System;


	/// <summary>
	/// Library folder.
	/// </summary>

	internal class LibraryFolder : Folder
	{
		bool isSystemFolder;


		/// <summary>
		/// Initialize a new instance for the specified folder GUID.
		/// </summary>
		/// <param name="guid">The GUID of the folder.</param>
		public LibraryFolder (string guid)
			: base(guid)
		{
			this.IsPinned = true;
		}


		/// <summary>
		/// Copy constructor.  Used by properties editor.
		/// </summary>
		/// <param name="folder">The existing instance to copy.</param>
		public LibraryFolder (LibraryFolder folder)
			: this(folder.Guid)
		{
			this.Name = folder.Name;
			this.Path = folder.Path;
			this.Image = folder.Image;
			this.ImageRes = folder.ImageRes;
			this.IsPinned = folder.IsPinned;
			this.DescriptionPath = folder.DescriptionPath;
			this.SetSystemFolder(folder.IsSystemFolder);
		}


		/// <summary>
		/// Gets or sets the path of the description file of this instance.
		/// </summary>
		public string DescriptionPath
		{
			get;
			set;
		}


		/// <summary>
		/// Gets a value indicating whether this is a known system folder.
		/// </summary>
		public override bool IsSystemFolder
		{
			get { return isSystemFolder; }
		}


		/// <summary>
		/// Sets the IsSystemFolder property.
		/// </summary>
		/// <param name="value"></param>
		public void SetSystemFolder (bool value)
		{
			isSystemFolder = value;
		}


		/// <summary>
		/// Returns the canonical display name of this folder.
		/// </summary>
		/// <returns>A string specifying the display name.</returns>
		public override string ToString ()
		{
			return Name;
		}
	}
}
